package com.bestcem.xm.user.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 用户操作日志操作编号
 *
 * @author yanjishuo <jishuo.yan@idiaoyan.com>
 * @version v1.0
 * @date 2022/05/10 15:02
 */
@Getter
@AllArgsConstructor
public enum UserOperateLogOperationEnum {

    /**
     * 操作日志分类枚举
     */
    OPERATE_LOG_OPERATION_INVALIDATE(0, "停用该账号"),
    OPERATE_LOG_OPERATION_ACTIVATE(1, "启用该账号"),
    OPERATE_LOG_OPERATION_SEL_PACKAGE(2, "选择套餐"),
    OPERATE_LOG_OPERATION_ADD_INDUSTRY(3, "添加行业"),
    OPERATE_LOG_OPERATION_DEL_INDUSTRY(4, "删除行业"),
    OPERATE_LOG_OPERATION_OPENMODULE(5, "打开模块"),
    OPERATE_LOG_OPERATION_CLOSE_MODULE(6, "关闭模块"),
    OPERATE_LOG_OPERATION_R1(7, "保留"),
    OPERATE_LOG_OPERATION_R2(8, "保留"),
    OPERATE_LOG_OPERATION_R3(9, "保留"),
    OPERATE_LOG_OPERATION_R4(10, "保留"),
    OPERATE_LOG_OPERATION_UPDATE_ORG(11, "更新公司信息"),
    OPERATE_LOG_OPERATION_UPDATE_EXPIRUDT(12, "修改到期时间"),
    OPERATE_LOG_OPERATION_UPDATE_NAME(13, "修改公司姓名"),
    OPERATE_LOG_OPERATION_UPDATE_INDUSTRY_ID(14, "修改所属行业"),
    OPERATE_LOG_OPERATION_UPDATE_CODE(15, "修改公司代号"),
    OPERATE_LOG_OPERATION_UPDATE_SMS_PRICE(16, "修改短信价格"),
    OPERATE_LOG_OPERATION_UPDATE_INNER(17, "修改是否内部"),
    OPERATE_LOG_OPERATION_UPDATE_FOOTER(18, "修改是否露出品牌"),
    OPERATE_LOG_OPERATION_UPDATE_PACKAGE_ID(19, "修改套餐"),
    OPERATE_LOG_OPERATION_UPDATE_PRINCIPAL_OP(20, "修改负责人"),
    OPERATE_LOG_OPERATION_UPDATE_RELEATE_OP_LIST(21, "修改关联人"),
    ;

    /**
     * 状态
     */
    private Integer type;
    /**
     * 状态描述
     */
    private String desc;

    /**
     * 通过type获取
     *
     * @param type
     * @return
     */
    public static UserOperateLogOperationEnum getByType(Integer type) {
        if (type != null) {
            for (UserOperateLogOperationEnum value : values()) {
                if (value.getType().equals(type)) {
                    return value;
                }
            }
        }
        return null;
    }
}
